package top.andnux.weather.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;

import java.io.File;

import top.andnux.weather.databinding.ActivityPicturePreviewBinding;


public class PicturePreviewActivity extends BaseActivity<ActivityPicturePreviewBinding> {

    @Override
    protected ActivityPicturePreviewBinding createViewBinding(LayoutInflater inflater) {
        return ActivityPicturePreviewBinding.inflate(inflater);
    }

    public static void start(Context context, String path) {
        Intent intent = new Intent(context, PicturePreviewActivity.class);
        intent.putExtra("path", path);
        context.startActivity(intent);
    }

    @Override
    protected void onCreated(@Nullable Bundle savedInstanceState) {
        String path = getIntent().getStringExtra("path");
        Glide.with(this).load(new File(path)).into(binding.imageView);
    }
}